<template>
	<!-- <div class="box">这是APP</div> -->
	<el-config-provider :locale="locale">
		<router-view />
	</el-config-provider>
</template>

<script setup lang="ts" name="App">
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'dayjs/locale/zh-cn'
defineOptions({
	name: 'hcwl-h5',
});
let locale = zhCn

onBeforeMount(() => {
	if (import.meta.env.DEV) {
		const title = '鑫莘学苑'
		// 开发环境配置
		if (import.meta.env.HCWL_API_BASE_URL === '/api') {
			window.document.title = '[测试的]' + title
		} else if (import.meta.env.HCWL_API_BASE_URL === '/formalapi') {
			window.document.title = '[正式的]' + title
		}
	}
})
//@ts-expect-error
const node = process.env.NODE_ENV
//只能在生产环境禁止右键和f12 开发环境不处理production
if (node !== 'development') {
	//禁止右击
	document.oncontextmenu = new Function("event.returnValue=false") as any;
	// // 禁止f12
	document.addEventListener("keydown", function (e) {
		if (e.key == "F12") {
			e.preventDefault(); // 如果按下键F12,阻止事件
		}
	});
}
</script>

<style lang="scss"></style>
